package objects;

import java.util.*;

public class Player {

	private String playerName = "";
	
	private ArrayList<Item> playerHold;
	
	
	private Ship playerShip;
	
	
	
	
	
	// ************** Constructors ********************
	
	public Player(){
		
		playerName = "Tester";
		playerShip = new Ship("U.S.S. Tester", 10, 2);
				
		playerHold = new ArrayList<Item>(20);
	}// debug constructor
	
	
	public Player(String name, String shipname){
		
		playerName = name;
		playerShip = new Ship(shipname, 10, 2);
		
		playerHold = new ArrayList<Item>(20);
	}//name only constructor
	
	
	// *********************** Inventory Management **********************
	
	public void addHoldItem(Item o){
		
		playerHold.add(o);
		
	}//
	
	public void removeHoldItemIndex(int i){
		
		playerHold.remove(i);
		
	}//end remove
	
	public void removeHoldItemID(Item o){
		
		for(int i = 0; i < playerHold.size(); i++){
			
			if(o == playerHold.get(i)){
				removeHoldItemIndex(i);
				break;
			}//end if
		}//for loop end
		
		
		
	}//end remove
	
	
	
	
	
	
	// ****************** Set Methods ********************
	
	public void setName(String a){
		playerName = a;
	}//end setPlayerName
	
	
	
	public void setShip(Ship a){
		playerShip = a;
	}//end setPlayerShip
	
	
	
	
	// *************** GET METHODS **********************
	 public String getName(){
		 return playerName;
	 }//end getPlayerName
	
	 public Ship getShip(){
	
		 return playerShip;
	 }// end getShip
	
	 public ArrayList<Item> getHold(){
		 return playerHold;
	 }//ed getPlayerHold
	
	
}//end class Player
